checkArgumentInRange

open fun checkArgumentInRange(value: Int, lower: Int, upper: Int, @NonNull valueName: String): Int(source)

Ensures that the argument int value is within the inclusive range.

Return

the validated int value

Parameters

value

a int value

lower

the lower endpoint of the inclusive range

upper

the upper endpoint of the inclusive range

valueName

the name of the argument to use if the check fails

Throws

if value was not within the range


open fun checkArgumentInRange(value: Long, lower: Long, upper: Long, @NonNull valueName: String): Long(source)

Ensures that the argument long value is within the inclusive range.

Return

the validated long value

Parameters

value

a long value

lower

the lower endpoint of the inclusive range

upper

the upper endpoint of the inclusive range

valueName

the name of the argument to use if the check fails

Throws

if value was not within the range


open fun checkArgumentInRange(value: Float, lower: Float, upper: Float, @NonNull valueName: String): Float(source)

Ensures that the argument float value is within the inclusive range.

Return

the validated float value

Parameters

value

a float value

lower

the lower endpoint of the inclusive range

upper

the upper endpoint of the inclusive range

valueName

the name of the argument to use if the check fails

Throws

if value was not within the range


open fun checkArgumentInRange(value: Double, lower: Double, upper: Double, @NonNull valueName: String): Double(source)

Ensures that the argument double value is within the inclusive range.

Return

the validated double value

Parameters

value

a double value

lower

the lower endpoint of the inclusive range

upper

the upper endpoint of the inclusive range

valueName

the name of the argument to use if the check fails

Throws

if value was not within the range